home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 3
/
Info_Mac_1994-01.iso
/
Graphics
/
Utility
/
GL Viewer 1.1.1
/
src ƒ
/
xlib.h
< prev
Wrap
Text File
|
1993-09-05
|
5KB
|
308 lines
#ifndef H_xlib
#define H_xlib
/*
xlib.h
mac hack at X window calls
oct91
*/
#include <Types.h>
typedef char Bool;
#define DoRed 1
#define DoBlue 2
#define DoGreen 4
#define XYBitmap 1
#define XYPixmap 2
#define ZPixmap 3
#define TextImage 4
#define LSBFirst 0
#define MSBFirst 1
#define AllocNone 0
typedef int* Colormap;
typedef char* Pixmap;
typedef int Display;
typedef Pixmap Drawable; // Pixmap is used as drawable in some places...
typedef Pixmap Window;
typedef int xCursor;
typedef int GC;
typedef int Visual;
typedef int VisualID;
typedef struct {
int x,y;
int width,height;
} XRectangle;
typedef struct {
unsigned long pixel;
unsigned short red,green,blue;
char flags;
char pad;
} XColor;
typedef struct _XImage {
int width,height; // size of image
int xoffset; //num pixels offset in X direction
int format; //XYBitmap,XYPixmap,ZPixmap,TextImage
char *data; // ptr to image
int byte_order; //data byte order LSB/MSBFirst
int bitmap_unit; //scanline 8/16/32
int bitmap_bit_order; //LSB/MSBFirst
int bitmap_pad; // 8/16/32 for Pixmaps
int depth; //depth of image
int bytes_per_line; //
int bits_per_pixel; //ZPixmap
unsigned long red_mask; //
unsigned long green_mask;
unsigned long blue_mask;
char *obdata; //hook for object routines
struct funcs { //image manip routines
struct _XImage *(*create_image)();
int (*destroy_image)();
unsigned long (*get_pixel)();
int (*put_pixel)();
struct _XImage *(*sub_image)();
int (*add_pixel)();
} f;
} XImage;
typedef struct {
Pixmap background_pixmap;
unsigned long background_pixel;
Pixmap border_pixmap;
unsigned long border_pixel;
int bit_gravity;
int win_gravity;
int backing_store;
unsigned long backing_planes;
unsigned long backing_pixel;
Bool save_under;
long event_mask;
long do_not_propogate_mask;
Bool override_redirect;
Colormap colormap;
xCursor cursor;
} XSetWindowAttributes;
typedef struct {
Visual *visual;
VisualID visualid;
int screen;
unsigned int depth;
int class;
unsigned long red_mask;
unsigned long green_mask;
unsigned long blue_mask;
int colormap_size;
int bits_per_rgb;
} XVisualInfo;
#define XSync(dsp, flag)
#define XSetClipMask(dsp, gc, a)
#define XSetClipRectangles(dsp, gc, a,b,c,d,e)
#define XDrawImageString(dsp, win, gc, a,b,c,d)
#define XDrawString(dsp, win, gc, x,y, s, slen)
#define XFreeColormap(dsp, cmap)
#define XMapWindow(dsp, win)
#define XCreateWindow(dsp, win, x, y, w, h, z, d, io, vis, bs, xswa) (Window)NULL
#define XMoveResizeWindow(dsp, win, x, y, w, h)
#define XUnmapWindow(dsp, win)
#define XDestroyWindow(dsp, win)
#if 0
#define XDrawLine(dsp, win, gc, x1, y1, x2, y2)
#define XDrawPoint(dsp, win, gc, x, y)
#endif
XImage *XCreateImage(
Display *dsp,
Visual *vis,
unsigned int depth,
int format,
int offset,
char *data,
unsigned int width,
unsigned int height,
int bitmap_pad,
int bytes_per_line);
void XPutImage(
Display *dsp,
Drawable win,
GC gc,
XImage *image,
int src_x,
int src_y,
int dest_x,
int dest_y,
unsigned int width,
unsigned int height);
void XCopyArea(
Display *dsp,
Drawable src,
Drawable dest,
GC gc,
int src_x,
int src_y,
unsigned int width,
unsigned int height,
int dest_x,
int dest_y);
Pixmap XCreatePixmap(
Display *dsp,
Drawable win,
unsigned int width,
unsigned int height,
unsigned int depth);
void XFreePixmap(
Display *dsp,
Pixmap pix);
Display *XOpenDisplay(
char* name);
void XCloseDisplay(
Display *dsp);
int XResizeWindow(
Display *dsp,
Drawable win,
unsigned int width,
unsigned int height);
void XSetWindowColormap(
Display *dsp,
Drawable win,
Colormap cmap);
int XAllocColorCells(
Display *dsp,
Colormap cmap,
Bool contig,
unsigned long plane_masks_return[],
unsigned int nplanes,
unsigned long pixels_return[],
unsigned int npixels);
void XStoreColors(
Display *dsp,
Colormap cmap,
XColor color[],
int ncolors);
Colormap XCreateColormap(
Display *dsp,
Window win,
Visual *vis,
int allocflag);
void XSetForeground(
Display *dsp,
GC gc,
unsigned long foreground);
void XSetBackground(
Display *dsp,
GC gc,
unsigned long background);
void XFillRectangle(
Display *dsp,
Drawable win,
GC gc,
int x,
int y,
int width,
int height);
void XFillRectangles(
Display *dsp,
Drawable win,
GC gc,
XRectangle *rects,
int nrects);
void XDrawLine(
Display *dsp,
Drawable win,
GC gc,
int x1,
int y1,
int x2,
int y2);
void XDrawPoint(
Display *dsp,
Drawable win,
GC gc,
int x,
int y);
void XExit (
int status);
void XSetBlackAndWhite (
Display *dsp, Drawable win);
#if 1
enum
{
FillStippled,
FillSolid
};
void XSetFillStyle (
Display *dsp,
GC gc,
int fill_style);
void XSetStipple (
Display *dsp,
GC gc,
Pixmap stipple);
void XSetTSOrigin (
Display *dsp,
GC gc,
int ts_x_origin,
int ts_y_origin);
#else
#define XSetFillStyle(dsp, gc, a);
#define XSetStipple(dsp, gc, pix)
#define XSetTSOrigin(dsp, gc, x, y)
#endif
Bool optionKeyIsDown();
Bool capsLockIsDown();
Bool shiftKeyIsDown();
Bool cmdKeyIsDown();
Bool StopKey();
Bool MouseButton();
Bool Keypress(int *pKeypressed);
int usleep( unsigned long usec);
long hundredthsofseconds();
char *StdGetFile(
char* prompt,
OSType fileTypes[],
int nFileTypes);
#endif /* H_xlib */